package com.qezhhnjy.demo.event;

import cn.hutool.extra.spring.SpringUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.annotation.Import;

/**
 * @author zhaoyangfu - 2021/1/4 14:24
 */
@SpringBootApplication
@Import(cn.hutool.extra.spring.SpringUtil.class)
public class EventApplication {

    public static void main(String[] args) {
        SpringApplication.run(EventApplication.class, args);
        SpringUtil.getApplicationContext().publishEvent(new ApplicationEvent("ass") {
            @Override
            public Object getSource() {
                return source;
            }
        });
    }
}
